<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common.html::common_css">
</head>
<script type="text/javascript" th:src="@{/static/js/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{/static/js/jquery-3.1.1.js}"></script>
<style>
    /*a  upload */
    .a-upload {
        height: 38px;
        width: 86px;
        top: 15px;
        padding: 8px 10px;
        line-height: 20px;
        position: relative;
        cursor: pointer;
        color: #888;
        background: #fafafa;
        border: 1px solid #ddd;
        border-radius: 4px;
        overflow: hidden;
        display: inline-block;
        *display: inline;
        *zoom: 1
    }

    .a-upload  input {
        width:100%;
        height: 100%;
        position: absolute;
        font-size: 100px;
        right: 0;
        top: 0;
        opacity: 0;
        filter: alpha(opacity=0);
        cursor: pointer
    }

    .a-upload:hover {
        color: #444;
        background: #eee;
        border-color: #ccc;
        text-decoration: none
    }

    #msg{
        width: 400px;
        position: fixed;
        display:none;
        left:40%;
        top:20%;
        z-index:11;
    }

    #finexam{
        width: 400px;
        position: fixed;
        display:none;
        left:40%;
        top:20%;
        z-index:11;
    }

    #popLayer {
        top: -66px;
        position: fixed;
        width: 100%;
        height: 120%;
        display: none;
        z-index: 10;
        background: #222;
        -moz-opacity: 0.8;
        opacity: .80;
        filter: alpha(opacity=80);
    }
</style>
<script type="text/javascript" th:src="@{/static/js/quesmutilup.js}"></script>
<body>
<div id="popLayer" >
</div>
<div id="msg" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
     aria-hidden="true" class="text-left" style="position: center;">
    <div role="document" class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header" style="margin-left: 20px;margin-right: 20px">
                <h5 id="exampleModalLabel1" class="modal-title">批量添加成功!</h5>
            </div>
            <div class="modal-footer"
                 style="display: block;padding: 1rem;text-align: center;margin-left: 20px;margin-right: 20px">
                <button id="btn"  style="border-radius: 4px;width: 100px" type="button" onclick="closeBox()" class="btn btn-primary">确定
                </button>
            </div>
        </div>
    </div>
</div>
<div id="finexam" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
     aria-hidden="true" class="text-left" style="position: center;">
    <div role="document" class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header" style="margin-left: 20px;margin-right: 20px">
                <h5 id="exampleModalLabel" style="color: red" class="modal-title">添加失败，未选择文件或文件内容格式有误！</h5>
            </div>
            <div class="modal-footer"
                 style="display: block;padding: 1rem;text-align: center;margin-left: 20px;margin-right: 20px">
                <button id="btn1" style="border-radius: 4px;width: 100px" type="button" onclick="cancelBox()" class="btn btn-primary">确定
                </button>
            </div>
        </div>
    </div>
</div>
<div th:replace="common/admin_common.html::common_sidebar"></div>
<div class="page">
    <div th:replace="common/admin_common.html::common_navbar"></div>
    <!-- Breadcrumb-->

    <div class="breadcrumb-holder">
        <div class="container-fluid">
            <ul class="breadcrumb">
                <li class="breadcrumb-item"><a th:href="@{/admin/admin_index.html}">主页</a></li>
                <li class="breadcrumb-item"><a th:href="@{/admin/testlib_manage.html}">题库管理</a></li>
                <li class="breadcrumb-item"><a
                        th:href="@{/admin/testlib_information.html/{id}(id=${apartmentid})}">题库详情</a></li>
                <li class="breadcrumb-item active">添加题目</li>
            </ul>
        </div>
    </div>
    <section>
        <div class="container-fluid">
            <!-- Page Header-->
            <header>
                <h1 class="h3 display">题库详情</h1>
            </header>
            <div class="row">
                <div class="col-lg-6" style="flex:100%;max-width: 100%">
                    <div class="card">
                        <div class="card-header">
                            <h4>批量添加题目</h4>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive" style="overflow-x:visible">
                                <form id="fileForm" enctype="multipart/form-data" class="text-left form-validate" th:action="@{/admin/import}" method="post">
                                    <div class="form-group text-center">
                                        <a href="javascript:;" class="a-upload">选择文件
                                            <input  id="file" type="file" accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"  name="file"/>
                                        </a>
                                        <a th:href="@{/admin/downTemplate}"
                                           type="button" class="btn btn-warning m-b-10 m-1-5"
                                           style="border-radius: 4px;margin-left: 30px">下载模板</a>
                                        <div style="margin-top: 20px" id="showFileName"></div>
                                    </div>
                                    <div class="form-group text-center">
                                        <button id="questionadd" style="margin-top: 20px;border-radius: 4px;width: 220px" type="button" value="批量添加" class="btn btn-primary">批量添加</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <div th:replace="common/common.html::common_footer"></div>
</div>
<div th:replace="common/common.html::common_js">
</div>
</body>
</html>